<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="cn.hpclub.server.util.DESECB" %>
<%@ page import="cn.hpclub.server.util.InterfaceUtil" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>移动大掌柜</title>
<script type="text/javascript" src="../template/assets/js/jquery.min.js"></script>


<% 
	String targetUrl = request.getParameter("url");
    String phoneNumber = request.getParameter("phone_no");
    String storeId = request.getParameter("storeId");
	
    // 通过该用户的org_id（即客户端传过来的storeId） 找到该用户所在城市、地区、店铺的numCode
    String cityNumCode = InterfaceUtil.getNumCodeOfCityByOrgId(storeId);
    String areaNumCode = InterfaceUtil.getNumCodeOfAreaByOrgId(storeId);
    String storeNumCode = InterfaceUtil.getNumCodeOfStoreByOrgId(storeId);
    
    
    // 20160321 来自吕佳沛信息，CITY DISTRICT WEBSITE 分别对应 机构表中的NumCode
    String text = "REFEREE_NO=" + phoneNumber + "&CITY=" + cityNumCode + "&DISTRICT=" + areaNumCode + "&WEBSITE="
            + storeNumCode + "&CHANNEL_ID=DZG";
    String key = "dzg2016@1234";
    DESECB des = new DESECB(key);
    String encryStr = des.encrypt(text);
    
	response.sendRedirect(targetUrl + "?canAppShare=1&data=" + encryStr);
%>


</head>
<body>
</body>
</html>